<div class="modal fade" id="upgrade-rule">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">&times;</span>
                    <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">Upgrade Rule</h4>
            </div>
            <div class="modal-body">
                <form>
                    <table class="table-form">
                        <tr>
                            <td width="20%"></td>
                            <td width="25%"></td>
                            <td width="20%"></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>Upload Cycle</td>
                            <td colspan="2">
                                <div class="dropdown" select-emu>
                                    <button class="btn btn-default dropdown-toggle" type="button"
                                            data-toggle="dropdown">
                                        <span class="choosen-value">{{ rule.upgradePeriod === 1 ? '24 Hours' : '7 days'}}</span>
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu" role="menu">
                                        <li role="presentation">
                                            <a role="menuitem" tabindex="-1" ng-click="rule.upgradePeriod = 1">24
                                                Hours</a>
                                        </li>
                                        <li role="presentation">
                                            <a role="menuitem" tabindex="-1" ng-click="rule.upgradePeriod = 7">7
                                                days</a>
                                        </li>
                                    </ul>
                                </div>
                            </td>
                            <td>
                                <small class="small">Request Cycle of Client to Admin</small>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">WIFI Automatic Upgrade(Silent Upgrade)</td>
                            <td>
                                <div class="radio-group">
                                    <div class="custom-radio bordered {{rule.autoDownwifi === 1?'checked':''}}"
                                         ng-click="rule.autoDownwifi = 1"><i></i></div>
                                    <label ng-click="rule.autoDownwifi = 1">Yes</label>

                                    <div class="custom-radio bordered {{rule.autoDownwifi === 0?'checked':''}}"
                                         ng-click="rule.autoDownwifi = 0"><i></i></div>
                                    <label ng-click="rule.autoDownwifi = 0">No</label>
                                </div>
                            </td>
                            <td>
                                <small class="small">Only WIFI mode, with old version app</small>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">Delete Installation on package after upgrade</td>
                            <td>
                                <div class="radio-group">
                                    <div class="custom-radio bordered {{rule.delUpgradeapk === 1?'checked':''}}"
                                         ng-click="rule.delUpgradeapk = 1"><i></i></div>
                                    <label ng-click="rule.delUpgradeapk = 1">Yes</label>

                                    <div class="custom-radio bordered {{rule.delUpgradeapk === 0?'checked':''}}"
                                         ng-click="rule.delUpgradeapk = 0"><i></i></div>
                                    <label ng-click="rule.delUpgradeapk = 0">No</label>
                                </div>
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td colspan="2">Clear Cache</td>
                            <td>
                                <div class="radio-group">
                                    <div class="custom-radio bordered {{rule.clearCache === 1?'checked':''}}"
                                         ng-click="rule.clearCache = 1"><i></i></div>
                                    <label ng-click="rule.clearCache = 1">Yes</label>

                                    <div class="custom-radio bordered {{rule.clearCache === 0?'checked':''}}"
                                         ng-click="rule.clearCache = 0"><i></i></div>
                                    <label ng-click="rule.clearCache = 0">No</label>
                                </div>
                            </td>
                            <td></td>
                        </tr>
                    </table>
                </form>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary btn-confirm" id="save-rule" ng-click="saveRule()">OK
                </button>
                <button type="button" class="btn btn-default btn-confirm" data-dismiss="modal">Cancel</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->